package cn.jnetty.utils.create.dto;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 猪哥亮
 * @email 1030681978@qq.com
 * @date 2020/4/20 16:39
 * 描述：
 */
public class PrimitiveManager {
    private static Map<Class<?>,PrimitiveDto> primitiveMap = new HashMap<>();
    public static void put(Class<?> clazz,PrimitiveDto dto){
        primitiveMap.put(clazz,dto);
    }
    public static PrimitiveDto get(Class<?> clazz){
        PrimitiveDto orDefault = primitiveMap.getOrDefault(clazz, null);
        return orDefault == null ? null : orDefault.deepyClone();
    }
    public static boolean isPrimitive(Class<?> clazz){
        return primitiveMap.containsKey(clazz);
    }
}
